package com.cakeclient.database;


public class ClientTable extends DatabaseTable {
    public static final String TABLESNAME = "ClientTable";
    public static final String ID = "_id";
    public static final String REMOTE_ID = "remoteId";
    public static final String NAME = "name";
    public static final String FIRSTNAME = "firstname";
    public static final String ISMALE = "isMale";
    public static final String BIRTHDATE = "birthdate";
    public static final String SUBSCRIPTIONDATE = "subscriptionDate";
    public static final String PHOTO = "photo";
    public static final String MOBILEPHONE = "mobilePhone";
    public static final String DEVICEID = "deviceId";
    public static final String LATESTKNOWNPOSITONIDPOSITIONID = "latestKnownPositionId";
    public static final String LIVINGPLACEID = "livingPositionId";

    public static final String[] ALLFIELDS = new String[]{
            ID,
            REMOTE_ID,
            NAME,
            FIRSTNAME,
            ISMALE,
            BIRTHDATE,
            SUBSCRIPTIONDATE,
            PHOTO,
            MOBILEPHONE,
            DEVICEID,
            LATESTKNOWNPOSITONIDPOSITIONID,
            LIVINGPLACEID

    };

    public static final String CREATE = "CREATE TABLE " + TABLESNAME
            + " ( "
            + ID + " INTEGER PRIMARY KEY AUTOINCREMENT , "
            + REMOTE_ID + " INTEGER ,"
            + NAME + " TEXT , "
            + FIRSTNAME + " TEXT , "
            + ISMALE + " INTEGER , "
            + BIRTHDATE + " TIMESTAMP DEFAULT current_timestamp , "
            + SUBSCRIPTIONDATE + " TIMESTAMP DEFAULT current_timestamp , "
            + PHOTO + " TEXT , "
            + MOBILEPHONE + " TEXT , "
            + DEVICEID + " TEXT , "
            + LATESTKNOWNPOSITONIDPOSITIONID + " INTEGER , "
            + LIVINGPLACEID + " INTEGER ); ";


    private static DatabaseTable ourInstance = new ClientTable();


    @Override
    public String getTableName() {
        return TABLESNAME;
    }

    @Override
    public String[] getAllFields() {
        return ALLFIELDS;
    }

    @Override
    public String getCreate() {
        return CREATE;
    }

    public static DatabaseTable getInstance() {
        return ourInstance;
    }

    private ClientTable() {
    }
}
